<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="box">
			<div class="sex">
				<input type="radio" name="sex"  value="1"/><label for="sex">男</label>
				<input type="radio" name="sex"  value="2"/><label for="sex">女</label>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var sexs = document.querySelectorAll(".sex>input[type='radio']");
		
		
		function getsexV(){
			for(i=0;i<sexs.length;i++){
				if(sexs[i].checked){
					return sexs[i].value;
				}
			}
		}
		
		function getsexfn(value){
			return value == 1?"男":"女"
		}
	</script>
</html>
